Trò chơi Pac-Man

20.565 lượt xem;
1 using UnityEngine;
2 using
System.Collections;
3
4 public
class TargetGizmo : MonoBehaviour {
5
6     
public GameObject ghost;
7
8     
// Use this for initialization
9     
void Start ()
10     {
11     
12     }
13     
14     
// Update is called once per frame
15     
void Update ()
16     {
17         
if(ghost.GetComponent<AI>().targetTile != null)
18         {
19             Vector3 pos =
new Vector3(ghost.GetComponent<AI>().targetTile.x,
20                                         ghost.GetComponent<AI>().targetTile.y,
0f);
21             transform.position = pos;
22         }
23     }
24 }


Use this for initialization

Update is called once per frame



Gõ tìm kiếm nhanh...